package com.leaf.lowcode.API;

import com.alibaba.fastjson.JSON;
import com.hikvision.artemis.sdk.ArtemisHttpUtil;
import com.hikvision.artemis.sdk.config.ArtemisConfig;
import com.leaf.lowcode.entity.PersonInfoRequest;
import com.leaf.lowcode.entity.SearchesRequest;

import java.util.HashMap;
import java.util.Map;

public class PeronQueryApi {


    static {
        ArtemisConfig.host = "10.140.161.12:443";
        ArtemisConfig.appKey = "29544061"; // 秘钥appkey
        ArtemisConfig.appSecret = "N1Ims5vjYUTQIGdItUjc";
    }
    /**
     * STEP2：设置OpenAPI接口的上下文
     */
    private static final String ARTEMIS_PATH = "/artemis";

    //查询访客出入事件
    public  String personInfoSearch(PersonInfoRequest searchRequest ){
        String searchDataApi = ARTEMIS_PATH +"/api/resource/v1/person/condition/personInfo";
        Map<String,String> path = new HashMap<String,String>(2){
            {
                put("https://",searchDataApi);
            }
        };
        String body= JSON.toJSONString(searchRequest);
        String result = ArtemisHttpUtil.doPostStringArtemis(path,body,null,null,"application/json");
        return result;
    }

}
